
public class PairXY {

	private double x;
	private double y;
	
	public PairXY(double x,double y){
		this.x = x;
		this.y = y;
	}
	
	public void setXY(double x,double y) {
		this.x = x;
		this.y = y;
	}

	public double getX() {
		return x;
	}

	public double getY() {
		return y;
	}	
	
	public PairXY roundXY(){
		
		x = Math.round(x);
		y = Math.round(y);
		return this;
	}

	public void push(Direction direction) {
		switch (direction){
		case UP: 
				y+=1;
				break;
		case DOWN: 
				y-=1;
				break;
		case RIGHT: 
				x+=1;
				break;
		case LEFT: 
				x-=1;
				break;
			
		}	
	}
}
